package com.lhf.springcloud.DAO;

import com.lhf.springcloud.Entity.MajorInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface MajorDao {
    @Insert("insert into major_info (id,major_name,major_number,major_schooling,major_start_time,major_status,major_target,major_Basics) values((select uuid()),#{majorName},#{majorNumber},#{majorSchooling},#{majorStartTime},#{majorStatus},#{majorTarget},#{majorBasics})")
    void addCourse(MajorInfo majorInfo);
    @Select("select id,major_name majorName,major_number majorNumber,major_schooling majorSchooling,major_start_time majorStartTime,major_status majorStatus,major_target majorTarget,major_Basics majorBasics from major_info")
    List<MajorInfo> findAllMajorData();
    @Select("select id,major_name majorName,major_number majorNumber,major_schooling majorSchooling,major_start_time majorStartTime,major_status majorStatus,major_target majorTarget,major_Basics majorBasics from major_info where major_number=#{majorNumber}")
    MajorInfo findByMajorNumberData(String majorNumber);
}
